#include <iostream>
#include "App.h"
#include "Sprite.h"
#include "Text.h"
#include "Audio.h"
#include "Layer.h"
#include "UserAction.h"
#include "SlideDown.h"

using namespace JDL;
using namespace std;

int main()
{
  App	app(1920, 1080);
  Sprite	*sprite;
  Text		*text;
  Audio		audio;;
  UserAction	*act;
  SlideDown	*eff;
  SlideDown	*eff_2;

  sprite = new Sprite("lol.png");
  text = new Text("Bien \n  Jouay \n JDLibs", "font.ttf", 42);
  act = new UserAction(app.GetInput(), text);
  eff = new SlideDown(text, 1, true);
  sprite->SetPosition(0, 0);
  sprite->SetSubRect(0, 0, 1920, 1080);
  eff_2 = new SlideDown(sprite, 4);
  text->SetPosition(500, 500);
  text->AddEffect("slide", eff);
  sprite->AddEffect("trololol", eff_2);
  app.AddObject(sprite);
  app.AddObject(text);
  audio.PlayMusic("zik.mp3");
  while (!app.isQuit())
    {
      app.RenderFrame();
      act->Do();
    }
  return 0;
}
